{% from "macros/forms.html" import form_input %}
{% set form_error = form_error | default({}) %}
{% set address = organization.address | default({}) %}

<div class="bg-base-100 p-4">
  <h1 class="text-3xl font-bold w-1/2 ml-[10%]">{{ submit_text }}</h1>
  <p class="text-base-content/60 text-[0.7rem] mb-5 w-1/2 ml-[10%]">ID: {{ organization.id }}</p>

  <form id="organization-form"
        class="w-3/4 ml-[10%]"
        {{ form_action }}
        hx-swap="innerHTML"
        hx-target="#form-container"
        hx-target-error="#form-container">
    {% include "partials/admin_form_error.html" %}

    {{ form_input('Name', 'name', organization.name, form_error.name) }}
    {{ form_input('Description', 'description', organization.description, form_error.description, required=False) }}
    {{ form_input('Street', 'address[street]', address.street, form_error.street, required=False) }}
    {{ form_input('City', 'address[city]', address.city, form_error.city, required=False) }}
    {{ form_input('Country', 'address[country]', address.country, form_error.country, required=False) }}
    {{ form_input('ZIP', 'address[zip]', address.zip, form_error.zip, required=False) }}

    <input type="submit" class="btn btn-primary w-1/2" value="{{ submit_text }}" />
  </form>
</div>
